package com.example.collections;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

public class Main {
    public static void main(String[] args) {
        List<String> list = new ArrayList<>();
        list.add("zhangsan");
        list.add("lisi");
        list.add("C++");
        Collections.replaceAll(list, "C++", "Java");
        System.out.println(list);
    }
}
